/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'scdn.aliyuncs.com',
    ap-northeast-2-pop = 'scdn.aliyuncs.com',
    ap-south-1 = 'scdn.aliyuncs.com',
    ap-southeast-1 = 'scdn.aliyuncs.com',
    ap-southeast-2 = 'scdn.aliyuncs.com',
    ap-southeast-3 = 'scdn.aliyuncs.com',
    ap-southeast-5 = 'scdn.aliyuncs.com',
    cn-beijing = 'scdn.aliyuncs.com',
    cn-beijing-finance-1 = 'scdn.aliyuncs.com',
    cn-beijing-finance-pop = 'scdn.aliyuncs.com',
    cn-beijing-gov-1 = 'scdn.aliyuncs.com',
    cn-beijing-nu16-b01 = 'scdn.aliyuncs.com',
    cn-chengdu = 'scdn.aliyuncs.com',
    cn-edge-1 = 'scdn.aliyuncs.com',
    cn-fujian = 'scdn.aliyuncs.com',
    cn-haidian-cm12-c01 = 'scdn.aliyuncs.com',
    cn-hangzhou = 'scdn.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'scdn.aliyuncs.com',
    cn-hangzhou-finance = 'scdn.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'scdn.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'scdn.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'scdn.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'scdn.aliyuncs.com',
    cn-hangzhou-test-306 = 'scdn.aliyuncs.com',
    cn-hongkong = 'scdn.aliyuncs.com',
    cn-hongkong-finance-pop = 'scdn.aliyuncs.com',
    cn-huhehaote = 'scdn.aliyuncs.com',
    cn-north-2-gov-1 = 'scdn.aliyuncs.com',
    cn-qingdao = 'scdn.aliyuncs.com',
    cn-qingdao-nebula = 'scdn.aliyuncs.com',
    cn-shanghai = 'scdn.aliyuncs.com',
    cn-shanghai-et15-b01 = 'scdn.aliyuncs.com',
    cn-shanghai-et2-b01 = 'scdn.aliyuncs.com',
    cn-shanghai-finance-1 = 'scdn.aliyuncs.com',
    cn-shanghai-inner = 'scdn.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'scdn.aliyuncs.com',
    cn-shenzhen = 'scdn.aliyuncs.com',
    cn-shenzhen-finance-1 = 'scdn.aliyuncs.com',
    cn-shenzhen-inner = 'scdn.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'scdn.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'scdn.aliyuncs.com',
    cn-wuhan = 'scdn.aliyuncs.com',
    cn-yushanfang = 'scdn.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'scdn.aliyuncs.com',
    cn-zhangjiakou = 'scdn.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'scdn.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'scdn.aliyuncs.com',
    eu-central-1 = 'scdn.aliyuncs.com',
    eu-west-1 = 'scdn.aliyuncs.com',
    eu-west-1-oxs = 'scdn.aliyuncs.com',
    me-east-1 = 'scdn.aliyuncs.com',
    rus-west-1-pop = 'scdn.aliyuncs.com',
    us-east-1 = 'scdn.aliyuncs.com',
    us-west-1 = 'scdn.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('scdn', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddScdnDomainRequest {
  checkUrl?: string(name='CheckUrl', example='www.yourdomain.com/test.html'),
  domainName?: string(name='DomainName', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyuji4b6r4**'),
  scope?: string(name='Scope', example='overseas'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]'),
}

model AddScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model AddScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddScdnDomainResponseBody(name='body'),
}

async function addScdnDomainWithOptions(request: AddScdnDomainRequest, runtime: Util.RuntimeOptions): AddScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checkUrl)) {
    query['CheckUrl'] = request.checkUrl;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sources)) {
    query['Sources'] = request.sources;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addScdnDomain(request: AddScdnDomainRequest): AddScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addScdnDomainWithOptions(request, runtime);
}

model BatchDeleteScdnDomainConfigsRequest {
  domainNames?: string(name='DomainNames', example='example.com,aliyundoc.com'),
  functionNames?: string(name='FunctionNames', example='referer_white_list_set,https_force'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchDeleteScdnDomainConfigsResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model BatchDeleteScdnDomainConfigsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchDeleteScdnDomainConfigsResponseBody(name='body'),
}

async function batchDeleteScdnDomainConfigsWithOptions(request: BatchDeleteScdnDomainConfigsRequest, runtime: Util.RuntimeOptions): BatchDeleteScdnDomainConfigsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!Util.isUnset(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchDeleteScdnDomainConfigs',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchDeleteScdnDomainConfigs(request: BatchDeleteScdnDomainConfigsRequest): BatchDeleteScdnDomainConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDeleteScdnDomainConfigsWithOptions(request, runtime);
}

model BatchSetScdnDomainConfigsRequest {
  domainNames?: string(name='DomainNames', example='example.com,aliyundoc.com'),
  functions?: string(name='Functions', example='[{"functionArgs":[{"argName":"domain_name","argValue":"example.com"}],"functionName":"set_req_host_header"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchSetScdnDomainConfigsResponseBody = {
  domainConfigList?: {
    domainConfigModel?: [ 
    {
      configId?: long(name='ConfigId', example='1234567'),
      domainName?: string(name='DomainName', example='www.example.com'),
      functionName?: string(name='FunctionName', example='set_req_host_header'),
    }
  ](name='DomainConfigModel')
  }(name='DomainConfigList'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model BatchSetScdnDomainConfigsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchSetScdnDomainConfigsResponseBody(name='body'),
}

async function batchSetScdnDomainConfigsWithOptions(request: BatchSetScdnDomainConfigsRequest, runtime: Util.RuntimeOptions): BatchSetScdnDomainConfigsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!Util.isUnset(request.functions)) {
    query['Functions'] = request.functions;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchSetScdnDomainConfigs',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchSetScdnDomainConfigs(request: BatchSetScdnDomainConfigsRequest): BatchSetScdnDomainConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchSetScdnDomainConfigsWithOptions(request, runtime);
}

model BatchStartScdnDomainRequest {
  domainNames?: string(name='DomainNames', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStartScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model BatchStartScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchStartScdnDomainResponseBody(name='body'),
}

async function batchStartScdnDomainWithOptions(request: BatchStartScdnDomainRequest, runtime: Util.RuntimeOptions): BatchStartScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchStartScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchStartScdnDomain(request: BatchStartScdnDomainRequest): BatchStartScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchStartScdnDomainWithOptions(request, runtime);
}

model BatchStopScdnDomainRequest {
  domainNames?: string(name='DomainNames', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStopScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='324AEFFF-308C-4DA7-8CD3-01B277B98F28'),
}

model BatchStopScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchStopScdnDomainResponseBody(name='body'),
}

async function batchStopScdnDomainWithOptions(request: BatchStopScdnDomainRequest, runtime: Util.RuntimeOptions): BatchStopScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchStopScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchStopScdnDomain(request: BatchStopScdnDomainRequest): BatchStopScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchStopScdnDomainWithOptions(request, runtime);
}

model BatchUpdateScdnDomainRequest {
  domainName?: string(name='DomainName', example='example.com,aliyundoc.com'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-xxx'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}]'),
  topLevelDomain?: string(name='TopLevelDomain', example='example.com'),
}

model BatchUpdateScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model BatchUpdateScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchUpdateScdnDomainResponseBody(name='body'),
}

async function batchUpdateScdnDomainWithOptions(request: BatchUpdateScdnDomainRequest, runtime: Util.RuntimeOptions): BatchUpdateScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!Util.isUnset(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchUpdateScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchUpdateScdnDomain(request: BatchUpdateScdnDomainRequest): BatchUpdateScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchUpdateScdnDomainWithOptions(request, runtime);
}

model CheckScdnServiceRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CheckScdnServiceResponseBody = {
  enabled?: boolean(name='Enabled', example='true'),
  inDebt?: boolean(name='InDebt', example='false'),
  inDebtOverdue?: boolean(name='InDebtOverdue', example='false'),
  onService?: boolean(name='OnService', example='true'),
  requestId?: string(name='RequestId', example='4F51E9C3-728F-4E35-952D-0ED87A06A8A1'),
}

model CheckScdnServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckScdnServiceResponseBody(name='body'),
}

async function checkScdnServiceWithOptions(request: CheckScdnServiceRequest, runtime: Util.RuntimeOptions): CheckScdnServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckScdnService',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkScdnService(request: CheckScdnServiceRequest): CheckScdnServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkScdnServiceWithOptions(request, runtime);
}

model DeleteScdnDomainRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='4785C948-233E-45FD-BA27-1C2119BBC2CC'),
}

model DeleteScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScdnDomainResponseBody(name='body'),
}

async function deleteScdnDomainWithOptions(request: DeleteScdnDomainRequest, runtime: Util.RuntimeOptions): DeleteScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScdnDomain(request: DeleteScdnDomainRequest): DeleteScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScdnDomainWithOptions(request, runtime);
}

model DeleteScdnSpecificConfigRequest {
  configId?: string(name='ConfigId', example='2317'),
  domainName?: string(name='DomainName', example='example.com,aliyundoc.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteScdnSpecificConfigResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteScdnSpecificConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteScdnSpecificConfigResponseBody(name='body'),
}

async function deleteScdnSpecificConfigWithOptions(request: DeleteScdnSpecificConfigRequest, runtime: Util.RuntimeOptions): DeleteScdnSpecificConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScdnSpecificConfig',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteScdnSpecificConfig(request: DeleteScdnSpecificConfigRequest): DeleteScdnSpecificConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScdnSpecificConfigWithOptions(request, runtime);
}

model DescribeScdnCcInfoResponseBody = {
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
  status?: string(name='Status', example='enable'),
}

model DescribeScdnCcInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCcInfoResponseBody(name='body'),
}

async function describeScdnCcInfoWithOptions(runtime: Util.RuntimeOptions): DescribeScdnCcInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeScdnCcInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCcInfo(): DescribeScdnCcInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCcInfoWithOptions(runtime);
}

model DescribeScdnCcQpsInfoRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-11-30T00:55:00Z'),
  startTime?: string(name='StartTime', example='2017-11-30T00:55:00Z'),
}

model DescribeScdnCcQpsInfoResponseBody = {
  attacks?: {
    attack?: [ string ](name='Attack')
  }(name='Attacks'),
  requestId?: string(name='RequestId', example='FA2EE241-5E9D-488A-B36E-408BF81C077E'),
  timeScopes?: {
    timeScope?: [ 
    {
      interval?: string(name='Interval', example='60000'),
      start?: string(name='Start', example='1512003300000'),
    }
  ](name='TimeScope')
  }(name='TimeScopes'),
  totals?: {
    total?: [ string ](name='Total')
  }(name='Totals'),
}

model DescribeScdnCcQpsInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCcQpsInfoResponseBody(name='body'),
}

async function describeScdnCcQpsInfoWithOptions(request: DescribeScdnCcQpsInfoRequest, runtime: Util.RuntimeOptions): DescribeScdnCcQpsInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnCcQpsInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCcQpsInfo(request: DescribeScdnCcQpsInfoRequest): DescribeScdnCcQpsInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCcQpsInfoWithOptions(request, runtime);
}

model DescribeScdnCcTopIpRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-11-30T0 1:00:00Z'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='2'),
  startTime?: string(name='StartTime', example='2017-11-30T00:55:00Z'),
}

model DescribeScdnCcTopIpResponseBody = {
  attackIpDataList?: {
    attackIpDatas?: [ 
    {
      attackCount?: string(name='AttackCount', example='2018398'),
      ip?: string(name='Ip', example='1.XXX.XXX.4'),
    }
  ](name='AttackIpDatas')
  }(name='AttackIpDataList'),
  domainName?: string(name='DomainName', example='example.com'),
  requestId?: string(name='RequestId', example='FA2EE241-5E9D-488A-B36E-408BF81C077E'),
  total?: string(name='Total', example='246'),
}

model DescribeScdnCcTopIpResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCcTopIpResponseBody(name='body'),
}

async function describeScdnCcTopIpWithOptions(request: DescribeScdnCcTopIpRequest, runtime: Util.RuntimeOptions): DescribeScdnCcTopIpResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnCcTopIp',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCcTopIp(request: DescribeScdnCcTopIpRequest): DescribeScdnCcTopIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCcTopIpWithOptions(request, runtime);
}

model DescribeScdnCcTopUrlRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-11-30T0 1:00:00Z'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='30'),
  startTime?: string(name='StartTime', example='2017-11-30T00:55:00Z'),
}

model DescribeScdnCcTopUrlResponseBody = {
  attackUrlDataList?: {
    attackUrlDatas?: [ 
    {
      attackCount?: string(name='AttackCount', example='2018398'),
      url?: string(name='Url', example='/xxxxx/xxx'),
    }
  ](name='AttackUrlDatas')
  }(name='AttackUrlDataList'),
  domainName?: string(name='DomainName', example='example.com'),
  requestId?: string(name='RequestId', example='FA2EE241-5E9D-488A-B36E-408BF81C077E'),
  total?: string(name='Total', example='123'),
}

model DescribeScdnCcTopUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCcTopUrlResponseBody(name='body'),
}

async function describeScdnCcTopUrlWithOptions(request: DescribeScdnCcTopUrlRequest, runtime: Util.RuntimeOptions): DescribeScdnCcTopUrlResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnCcTopUrl',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCcTopUrl(request: DescribeScdnCcTopUrlRequest): DescribeScdnCcTopUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCcTopUrlWithOptions(request, runtime);
}

model DescribeScdnCertificateDetailRequest {
  certName?: string(name='CertName', example='certname'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnCertificateDetailResponseBody = {
  cert?: string(name='Cert', example='-----BEGIN CERTIFICATE-----xxx-----END CERTIFICATE-----'),
  certId?: long(name='CertId', example='123'),
  certName?: string(name='CertName', example='vmeixme'),
  key?: string(name='Key', example='key'),
  requestId?: string(name='RequestId', example='C7C69682-7F88-40DD-A198-10D0309E439B'),
}

model DescribeScdnCertificateDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCertificateDetailResponseBody(name='body'),
}

async function describeScdnCertificateDetailWithOptions(request: DescribeScdnCertificateDetailRequest, runtime: Util.RuntimeOptions): DescribeScdnCertificateDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnCertificateDetail',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCertificateDetail(request: DescribeScdnCertificateDetailRequest): DescribeScdnCertificateDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCertificateDetailWithOptions(request, runtime);
}

model DescribeScdnCertificateListRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        certId?: long(name='CertId', example='123'),
        certName?: string(name='CertName'),
        common?: string(name='Common', example='example.com'),
        fingerprint?: string(name='Fingerprint', example='xxx'),
        issuer?: string(name='Issuer', example='xxx'),
        lastTime?: long(name='LastTime', example='1512388610'),
      }
    ](name='Cert')
    }(name='CertList'),
    count?: int32(name='Count', example='2'),
  }(name='CertificateListModel'),
  requestId?: string(name='RequestId', example='FC0E34AC-0239-44A7-AB0E-800DE522C8DA'),
}

model DescribeScdnCertificateListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnCertificateListResponseBody(name='body'),
}

async function describeScdnCertificateListWithOptions(request: DescribeScdnCertificateListRequest, runtime: Util.RuntimeOptions): DescribeScdnCertificateListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnCertificateList',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnCertificateList(request: DescribeScdnCertificateListRequest): DescribeScdnCertificateListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnCertificateListWithOptions(request, runtime);
}

model DescribeScdnDDoSInfoResponseBody = {
  elasticBandwidth?: int32(name='ElasticBandwidth', example='80'),
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
  secBandwidth?: int32(name='SecBandwidth', example='20'),
}

model DescribeScdnDDoSInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDDoSInfoResponseBody(name='body'),
}

async function describeScdnDDoSInfoWithOptions(runtime: Util.RuntimeOptions): DescribeScdnDDoSInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeScdnDDoSInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDDoSInfo(): DescribeScdnDDoSInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDDoSInfoWithOptions(runtime);
}

model DescribeScdnDDoSTrafficInfoRequest {
  endTime?: string(name='EndTime', example='2017-11-30T00:56:00Z'),
  line?: string(name='Line', example='ALL'),
  startTime?: string(name='StartTime', example='2017-11-30T00:55:00Z'),
}

model DescribeScdnDDoSTrafficInfoResponseBody = {
  bpsDrops?: {
    bpsDrop?: [ string ](name='BpsDrop')
  }(name='BpsDrops'),
  bpsTotals?: {
    bpsTotal?: [ string ](name='BpsTotal')
  }(name='BpsTotals'),
  ppsDrops?: {
    ppsDrop?: [ string ](name='PpsDrop')
  }(name='PpsDrops'),
  ppsTotals?: {
    ppsTotal?: [ string ](name='PpsTotal')
  }(name='PpsTotals'),
  requestId?: string(name='RequestId', example='8EEEA133-B4E4-4BE4-B00D-93B60387D8FD'),
  timeScopes?: {
    timeScope?: [ 
    {
      interval?: string(name='Interval', example='60000'),
      start?: string(name='Start', example='1512003360000'),
    }
  ](name='TimeScope')
  }(name='TimeScopes'),
}

model DescribeScdnDDoSTrafficInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDDoSTrafficInfoResponseBody(name='body'),
}

async function describeScdnDDoSTrafficInfoWithOptions(request: DescribeScdnDDoSTrafficInfoRequest, runtime: Util.RuntimeOptions): DescribeScdnDDoSTrafficInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDDoSTrafficInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDDoSTrafficInfo(request: DescribeScdnDDoSTrafficInfoRequest): DescribeScdnDDoSTrafficInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDDoSTrafficInfoWithOptions(request, runtime);
}

model DescribeScdnDomainBpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T20:00:00Z'),
  interval?: string(name='Interval', example='300'),
  ispNameEn?: string(name='IspNameEn', example='alibaba'),
  locationNameEn?: string(name='LocationNameEn', example='cn-hangzhou'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainBpsDataResponseBody = {
  bpsDataPerInterval?: {
    dataModule?: [ 
    {
      bpsValue?: string(name='BpsValue', example='11288111'),
      httpBpsValue?: string(name='HttpBpsValue', example='11286111'),
      httpsBpsValue?: string(name='HttpsBpsValue', example='2000'),
      timeStamp?: string(name='TimeStamp', example='2017-12-10T20:00:00Z'),
    }
  ](name='DataModule')
  }(name='BpsDataPerInterval'),
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainBpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainBpsDataResponseBody(name='body'),
}

async function describeScdnDomainBpsDataWithOptions(request: DescribeScdnDomainBpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainBpsDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!Util.isUnset(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainBpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainBpsData(request: DescribeScdnDomainBpsDataRequest): DescribeScdnDomainBpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainBpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainCertificateInfoRequest {
  domainName?: string(name='DomainName', example='example.com'),
}

model DescribeScdnDomainCertificateInfoResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certDomainName?: string(name='CertDomainName', example='example.com'),
      certExpireTime?: string(name='CertExpireTime', example='2018-06-03T22:03:39Z'),
      certLife?: string(name='CertLife', example='3 months'),
      certName?: string(name='CertName', example='example.com'),
      certOrg?: string(name='CertOrg', example='Let\\"s Encrypt'),
      certType?: string(name='CertType', example='free'),
      domainName?: string(name='DomainName', example='example.com'),
      SSLProtocol?: string(name='SSLProtocol', example='on'),
      SSLPub?: string(name='SSLPub', example='xxxx'),
      status?: string(name='Status', example='success'),
    }
  ](name='CertInfo')
  }(name='CertInfos'),
  requestId?: string(name='RequestId', example='5C1E43DC-9E51-4771-82C0-7D5ECEB547A1'),
}

model DescribeScdnDomainCertificateInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainCertificateInfoResponseBody(name='body'),
}

async function describeScdnDomainCertificateInfoWithOptions(request: DescribeScdnDomainCertificateInfoRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainCertificateInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainCertificateInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainCertificateInfo(request: DescribeScdnDomainCertificateInfoRequest): DescribeScdnDomainCertificateInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainCertificateInfoWithOptions(request, runtime);
}

model DescribeScdnDomainCnameRequest {
  domainName?: string(name='DomainName', example='aliyundoc.com'),
}

model DescribeScdnDomainCnameResponseBody = {
  cnameDatas?: {
    data?: [ 
    {
      cname?: string(name='Cname', description='Cname', example='example.com'),
      domain?: string(name='Domain', example='.aliyundoc.com'),
      status?: int32(name='Status', example='6'),
    }
  ](name='Data')
  }(name='CnameDatas'),
  requestId?: string(name='RequestId', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model DescribeScdnDomainCnameResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainCnameResponseBody(name='body'),
}

async function describeScdnDomainCnameWithOptions(request: DescribeScdnDomainCnameRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainCnameResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainCname',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainCname(request: DescribeScdnDomainCnameRequest): DescribeScdnDomainCnameResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainCnameWithOptions(request, runtime);
}

model DescribeScdnDomainConfigsRequest {
  configId?: string(name='ConfigId', example='123'),
  domainName?: string(name='DomainName', example='example.com'),
  functionNames?: string(name='FunctionNames', example='filetype_based_ttl_set,set_req_host_header'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnDomainConfigsResponseBody = {
  domainConfigs?: {
    domainConfig?: [ 
    {
      configId?: string(name='ConfigId', example='5003576'),
      functionArgs?: {
        functionArg?: [ 
        {
          argName?: string(name='ArgName', example='domain_name'),
          argValue?: string(name='ArgValue', example='example.com'),
        }
      ](name='FunctionArg')
      }(name='FunctionArgs'),
      functionName?: string(name='FunctionName', example='set_req_host_header'),
      parentId?: string(name='ParentId'),
      status?: string(name='Status', example='success'),
    }
  ](name='DomainConfig')
  }(name='DomainConfigs'),
  requestId?: string(name='RequestId', example='F8AA0364-0FDB-4AD5-AC74-D69FAB8924ED'),
}

model DescribeScdnDomainConfigsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainConfigsResponseBody(name='body'),
}

async function describeScdnDomainConfigsWithOptions(request: DescribeScdnDomainConfigsRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainConfigsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainConfigs',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainConfigs(request: DescribeScdnDomainConfigsRequest): DescribeScdnDomainConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainConfigsWithOptions(request, runtime);
}

model DescribeScdnDomainDetailRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnDomainDetailResponseBody = {
  domainDetail?: {
    certName?: string(name='CertName'),
    cname?: string(name='Cname', example='example.com.scdn7mhp.com'),
    description?: string(name='Description', example='audit failed'),
    domainName?: string(name='DomainName', example='example.com'),
    domainStatus?: string(name='DomainStatus', example='online'),
    gmtCreated?: string(name='GmtCreated', example='2017-11-27T06:51:26Z'),
    gmtModified?: string(name='GmtModified', example='2017-11-27T06:51:26Z'),
    resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyuji4b6r4ry'),
    SSLProtocol?: string(name='SSLProtocol', example='on'),
    SSLPub?: string(name='SSLPub', example='xxx'),
    scope?: string(name='Scope', example='overseas'),
    sources?: {
      source?: [ 
      {
        content?: string(name='Content', example='xxx.oss-cn-hangzhou.aliyuncs.com'),
        enabled?: string(name='Enabled', example='online'),
        port?: int32(name='Port', example='80'),
        priority?: string(name='Priority', example='50'),
        type?: string(name='Type', example='oss'),
      }
    ](name='Source')
    }(name='Sources'),
  }(name='DomainDetail'),
  requestId?: string(name='RequestId', example='09ABE829-6CD3-4FE0-AFEE-556113E29727'),
}

model DescribeScdnDomainDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainDetailResponseBody(name='body'),
}

async function describeScdnDomainDetailWithOptions(request: DescribeScdnDomainDetailRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainDetail',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainDetail(request: DescribeScdnDomainDetailRequest): DescribeScdnDomainDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainDetailWithOptions(request, runtime);
}

model DescribeScdnDomainHitRateDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2018-03-02T15:00:00Z'),
  interval?: string(name='Interval', example='300'),
  startTime?: string(name='StartTime', example='2018-03-02T12:00:00Z'),
}

model DescribeScdnDomainHitRateDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='3600'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2018-03-02T15:00:00Z'),
  hitRatePerInterval?: {
    dataModule?: [ 
    {
      byteHitRate?: string(name='ByteHitRate', example='0'),
      reqHitRate?: string(name='ReqHitRate', example='0'),
      timeStamp?: string(name='TimeStamp', example='2018-03-02T15:00:00Z'),
    }
  ](name='DataModule')
  }(name='HitRatePerInterval'),
  requestId?: string(name='RequestId', example='4D07ABFE-4737-4834-B1B9-A661308C47B4'),
  startTime?: string(name='StartTime', example='2018-03-02T12:00:00Z'),
}

model DescribeScdnDomainHitRateDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainHitRateDataResponseBody(name='body'),
}

async function describeScdnDomainHitRateDataWithOptions(request: DescribeScdnDomainHitRateDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainHitRateDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainHitRateData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainHitRateData(request: DescribeScdnDomainHitRateDataRequest): DescribeScdnDomainHitRateDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainHitRateDataWithOptions(request, runtime);
}

model DescribeScdnDomainHttpCodeDataRequest {
  domainName?: string(name='DomainName', example='example.com,aliyundoc.com'),
  endTime?: string(name='EndTime', example='2018-03-01T13:00:00Z'),
  interval?: string(name='Interval', example='300'),
  ispNameEn?: string(name='IspNameEn', example='alibaba'),
  locationNameEn?: string(name='LocationNameEn', example='cn-hangzhou'),
  startTime?: string(name='StartTime', example='2018-03-01T05:00:00Z'),
}

model DescribeScdnDomainHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='3600'),
  dataPerInterval?: {
    dataModule?: [ 
    {
      httpCodeDataPerInterval?: {
        httpCodeDataModule?: [ 
        {
          code?: string(name='Code', example='404'),
          count?: string(name='Count', example='16'),
          proportion?: string(name='Proportion', example='100'),
        }
      ](name='HttpCodeDataModule')
      }(name='HttpCodeDataPerInterval'),
      timeStamp?: string(name='TimeStamp', example='2018-03-01T13:00:00Z'),
    }
  ](name='DataModule')
  }(name='DataPerInterval'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2018-03-01T13:00:00Z'),
  requestId?: string(name='RequestId', example='91FC2D9D-B042-4634-8A5C-7B8E7482C22D'),
  startTime?: string(name='StartTime', example='2018-03-01T05:00:00Z'),
}

model DescribeScdnDomainHttpCodeDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainHttpCodeDataResponseBody(name='body'),
}

async function describeScdnDomainHttpCodeDataWithOptions(request: DescribeScdnDomainHttpCodeDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainHttpCodeDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!Util.isUnset(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainHttpCodeData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainHttpCodeData(request: DescribeScdnDomainHttpCodeDataRequest): DescribeScdnDomainHttpCodeDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainHttpCodeDataWithOptions(request, runtime);
}

model DescribeScdnDomainIspDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-07T12:00:00Z'),
  startTime?: string(name='StartTime', example='2015-12-05T12:00:00Z'),
}

model DescribeScdnDomainIspDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='86400'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-05T12:00:00Z'),
  requestId?: string(name='RequestId', example='2E5AD83F-BD7B-462E-8319-2E30E305519A'),
  startTime?: string(name='StartTime', example='2015-12-07T12:00:00Z'),
  value?: {
    ISPProportionData?: [ 
    {
      avgObjectSize?: string(name='AvgObjectSize', example='2888253.7875'),
      avgResponseRate?: string(name='AvgResponseRate', example='787.8073097249128'),
      avgResponseTime?: string(name='AvgResponseTime', example='3666.193181818182'),
      bps?: string(name='Bps', example='40343.86242857143'),
      bytesProportion?: string(name='BytesProportion', example='0.37532921137846464'),
      ISP?: string(name='ISP'),
      ispEname?: string(name='IspEname', example='China Mobile'),
      proportion?: string(name='Proportion', example='0.33908754623921084'),
      qps?: string(name='Qps', example='0.001746031746031746'),
      reqErrRate?: string(name='ReqErrRate', example='0'),
      totalBytes?: string(name='TotalBytes', example='254166333'),
      totalQuery?: string(name='TotalQuery', example='88'),
    }
  ](name='ISPProportionData')
  }(name='Value'),
}

model DescribeScdnDomainIspDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainIspDataResponseBody(name='body'),
}

async function describeScdnDomainIspDataWithOptions(request: DescribeScdnDomainIspDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainIspDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainIspData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainIspData(request: DescribeScdnDomainIspDataRequest): DescribeScdnDomainIspDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainIspDataWithOptions(request, runtime);
}

model DescribeScdnDomainLogRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2016-10-20T04:10:00Z'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  startTime?: string(name='StartTime', example='2016-10-20T04:00:00Z'),
}

model DescribeScdnDomainLogResponseBody = {
  domainLogDetails?: {
    domainLogDetail?: [ 
    {
      logCount?: long(name='LogCount', example='20'),
      logInfos?: {
        logInfoDetail?: [ 
        {
          endTime?: string(name='EndTime', example='1521975600'),
          logName?: string(name='LogName', example='example.com_2018_03_25_180000_190000.gz'),
          logPath?: string(name='LogPath', example='cdnlog2.aliyuncs.com/example.com/2018_03_25/example.com_2018_03_25_180000_190000.gz?'),
          logSize?: long(name='LogSize', example='2645401'),
          startTime?: string(name='StartTime', example='1521972000'),
        }
      ](name='LogInfoDetail')
      }(name='LogInfos'),
      pageInfos?: {
        pageNumber?: long(name='PageNumber', example='1'),
        pageSize?: long(name='PageSize', example='20'),
        total?: long(name='Total', example='20'),
      }(name='PageInfos'),
    }
  ](name='DomainLogDetail')
  }(name='DomainLogDetails'),
  domainName?: string(name='DomainName', example='example.com'),
  requestId?: string(name='RequestId', example='077D0284-F041-4A41-A932-B48377FDAA25'),
}

model DescribeScdnDomainLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainLogResponseBody(name='body'),
}

async function describeScdnDomainLogWithOptions(request: DescribeScdnDomainLogRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainLog',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainLog(request: DescribeScdnDomainLogRequest): DescribeScdnDomainLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainLogWithOptions(request, runtime);
}

model DescribeScdnDomainOriginBpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T20:00:00Z'),
  interval?: string(name='Interval', example='300'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainOriginBpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  originBpsDataPerInterval?: {
    dataModule?: [ 
    {
      httpOriginBpsValue?: string(name='HttpOriginBpsValue', example='100'),
      httpsOriginBpsValue?: string(name='HttpsOriginBpsValue', example='100'),
      originBpsValue?: string(name='OriginBpsValue', example='200'),
      timeStamp?: string(name='TimeStamp', example='2017-12-10T21:00:00Z'),
    }
  ](name='DataModule')
  }(name='OriginBpsDataPerInterval'),
  requestId?: string(name='RequestId', example='7CBCD6AD-B016-42E5-AE0B-B3731DE8F755'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainOriginBpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainOriginBpsDataResponseBody(name='body'),
}

async function describeScdnDomainOriginBpsDataWithOptions(request: DescribeScdnDomainOriginBpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainOriginBpsDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainOriginBpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainOriginBpsData(request: DescribeScdnDomainOriginBpsDataRequest): DescribeScdnDomainOriginBpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainOriginBpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainOriginTrafficDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  interval?: string(name='Interval', example='300'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainOriginTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  originTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      httpTrafficValue?: string(name='HttpTrafficValue', example='500'),
      httpsTrafficValue?: string(name='HttpsTrafficValue', example='500'),
      timeStamp?: string(name='TimeStamp', example='2017-12-10T21:00:00Z'),
      trafficValue?: string(name='TrafficValue', example='1000'),
    }
  ](name='DataModule')
  }(name='OriginTrafficDataPerInterval'),
  requestId?: string(name='RequestId', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainOriginTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainOriginTrafficDataResponseBody(name='body'),
}

async function describeScdnDomainOriginTrafficDataWithOptions(request: DescribeScdnDomainOriginTrafficDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainOriginTrafficDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainOriginTrafficData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainOriginTrafficData(request: DescribeScdnDomainOriginTrafficDataRequest): DescribeScdnDomainOriginTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainOriginTrafficDataWithOptions(request, runtime);
}

model DescribeScdnDomainPvDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-11-29T00:00:00Z'),
  startTime?: string(name='StartTime', example='2015-11-28T00:00:00Z'),
}

model DescribeScdnDomainPvDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='3600'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-11-29T00:00:00Z'),
  pvDataInterval?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2015-11-28T03:00:00Z'),
      value?: string(name='Value', example='9292'),
    }
  ](name='UsageData')
  }(name='PvDataInterval'),
  requestId?: string(name='RequestId', example='BCD7D917-76F1-442F-BB75-C810DE34C761'),
  startTime?: string(name='StartTime', example='2015-11-28T00:00:00Z'),
}

model DescribeScdnDomainPvDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainPvDataResponseBody(name='body'),
}

async function describeScdnDomainPvDataWithOptions(request: DescribeScdnDomainPvDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainPvDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainPvData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainPvData(request: DescribeScdnDomainPvDataRequest): DescribeScdnDomainPvDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainPvDataWithOptions(request, runtime);
}

model DescribeScdnDomainQpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  interval?: string(name='Interval', example='300'),
  ispNameEn?: string(name='IspNameEn', example='alibaba'),
  locationNameEn?: string(name='LocationNameEn', example='cn-hangzhou'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainQpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  qpsDataPerInterval?: {
    dataModule?: [ 
    {
      accValue?: string(name='AccValue', example='100'),
      httpAccValue?: string(name='HttpAccValue', example='50'),
      httpQpsValue?: string(name='HttpQpsValue', description='http QPS。', example='0.28'),
      httpsAccValue?: string(name='HttpsAccValue', example='50'),
      httpsQpsValue?: string(name='HttpsQpsValue', description='https QPS。', example='0.28'),
      qpsValue?: string(name='QpsValue', example='0.56'),
      timeStamp?: string(name='TimeStamp', example='2017-12-10T21:00:00Z'),
    }
  ](name='DataModule')
  }(name='QpsDataPerInterval'),
  requestId?: string(name='RequestId', example='BEA5625F-8FCF-48F4-851B-CA63946DA664'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainQpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainQpsDataResponseBody(name='body'),
}

async function describeScdnDomainQpsDataWithOptions(request: DescribeScdnDomainQpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainQpsDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!Util.isUnset(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainQpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainQpsData(request: DescribeScdnDomainQpsDataRequest): DescribeScdnDomainQpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainQpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeBpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2018-01-02T11:00:00Z'),
  ispNameEn?: string(name='IspNameEn', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', example='beijing'),
  startTime?: string(name='StartTime', example='2018-01-02T11:00:00Z'),
}

model DescribeScdnDomainRealTimeBpsDataResponseBody = {
  data?: {
    bpsModel?: [ 
    {
      bps?: float(name='Bps', example='16710625.733333332'),
      timeStamp?: string(name='TimeStamp', example='2018-01-02T11:05:00Z'),
    }
  ](name='BpsModel')
  }(name='Data'),
  requestId?: string(name='RequestId', example='B49E6DDA-F413-422B-B58E-2FA23F286726'),
}

model DescribeScdnDomainRealTimeBpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeBpsDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeBpsDataWithOptions(request: DescribeScdnDomainRealTimeBpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeBpsDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeBpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeBpsData(request: DescribeScdnDomainRealTimeBpsDataRequest): DescribeScdnDomainRealTimeBpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeBpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeByteHitRateDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeByteHitRateDataResponseBody = {
  data?: {
    byteHitRateDataModel?: [ 
    {
      byteHitRate?: float(name='ByteHitRate', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', example='2016-10-20T04:00:00Z'),
    }
  ](name='ByteHitRateDataModel')
  }(name='Data'),
  requestId?: string(name='RequestId', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
}

model DescribeScdnDomainRealTimeByteHitRateDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeByteHitRateDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeByteHitRateDataWithOptions(request: DescribeScdnDomainRealTimeByteHitRateDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeByteHitRateDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeByteHitRateData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeByteHitRateData(request: DescribeScdnDomainRealTimeByteHitRateDataRequest): DescribeScdnDomainRealTimeByteHitRateDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeByteHitRateDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeHttpCodeDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  ispNameEn?: string(name='IspNameEn', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', example='beijing'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  realTimeHttpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2017-12-10T20:00:00Z'),
      value?: {
        realTimeCodeProportionData?: [ 
        {
          code?: string(name='Code', example='111111'),
          count?: string(name='Count', example='1'),
          proportion?: string(name='Proportion', example='0.01155980271270037'),
        }
      ](name='RealTimeCodeProportionData')
      }(name='Value'),
    }
  ](name='UsageData')
  }(name='RealTimeHttpCodeData'),
  requestId?: string(name='RequestId', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeHttpCodeDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeHttpCodeDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeHttpCodeDataWithOptions(request: DescribeScdnDomainRealTimeHttpCodeDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeHttpCodeDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!Util.isUnset(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeHttpCodeData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeHttpCodeData(request: DescribeScdnDomainRealTimeHttpCodeDataRequest): DescribeScdnDomainRealTimeHttpCodeDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeHttpCodeDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeQpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2018-01-02T11:27:00Z'),
  ispNameEn?: string(name='IspNameEn', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', example='telecom'),
  startTime?: string(name='StartTime', example='2018-01-02T11:26:00Z'),
}

model DescribeScdnDomainRealTimeQpsDataResponseBody = {
  data?: {
    qpsModel?: [ 
    {
      qps?: float(name='Qps', example='1851.25'),
      timeStamp?: string(name='TimeStamp', example='2018-01-02T11:26:00Z'),
    }
  ](name='QpsModel')
  }(name='Data'),
  requestId?: string(name='RequestId', example='32DC9806-E9F9-4490-BBDC-B3A9E32FCC1D'),
}

model DescribeScdnDomainRealTimeQpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeQpsDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeQpsDataWithOptions(request: DescribeScdnDomainRealTimeQpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeQpsDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeQpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeQpsData(request: DescribeScdnDomainRealTimeQpsDataRequest): DescribeScdnDomainRealTimeQpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeQpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeReqHitRateDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:01:00Z'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeReqHitRateDataResponseBody = {
  data?: {
    reqHitRateDataModel?: [ 
    {
      reqHitRate?: float(name='ReqHitRate', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', example='2016-10-20T04:00:00Z'),
    }
  ](name='ReqHitRateDataModel')
  }(name='Data'),
  requestId?: string(name='RequestId', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
}

model DescribeScdnDomainRealTimeReqHitRateDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeReqHitRateDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeReqHitRateDataWithOptions(request: DescribeScdnDomainRealTimeReqHitRateDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeReqHitRateDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeReqHitRateData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeReqHitRateData(request: DescribeScdnDomainRealTimeReqHitRateDataRequest): DescribeScdnDomainRealTimeReqHitRateDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeReqHitRateDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeSrcBpsDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeSrcBpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  realTimeSrcBpsDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2015-12-10T20:01:00Z'),
      value?: string(name='Value', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeSrcBpsDataPerInterval'),
  requestId?: string(name='RequestId', example='7CBCD6AD-B016-42E5-AE0B-B3731DE8F755'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeSrcBpsDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeSrcBpsDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeSrcBpsDataWithOptions(request: DescribeScdnDomainRealTimeSrcBpsDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeSrcBpsDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeSrcBpsData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeSrcBpsData(request: DescribeScdnDomainRealTimeSrcBpsDataRequest): DescribeScdnDomainRealTimeSrcBpsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeSrcBpsDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeSrcTrafficDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeSrcTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='60'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  realTimeSrcTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2015-12-10T20:00:00Z'),
      value?: string(name='Value', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeSrcTrafficDataPerInterval'),
  requestId?: string(name='RequestId', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeSrcTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeSrcTrafficDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeSrcTrafficDataWithOptions(request: DescribeScdnDomainRealTimeSrcTrafficDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeSrcTrafficDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeSrcTrafficData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeSrcTrafficData(request: DescribeScdnDomainRealTimeSrcTrafficDataRequest): DescribeScdnDomainRealTimeSrcTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeSrcTrafficDataWithOptions(request, runtime);
}

model DescribeScdnDomainRealTimeTrafficDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='60'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-10T20:01:00Z'),
  realTimeTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2015-12-10T20:00:00Z'),
      value?: string(name='Value', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeTrafficDataPerInterval'),
  requestId?: string(name='RequestId', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', example='2015-12-10T20:00:00Z'),
}

model DescribeScdnDomainRealTimeTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRealTimeTrafficDataResponseBody(name='body'),
}

async function describeScdnDomainRealTimeTrafficDataWithOptions(request: DescribeScdnDomainRealTimeTrafficDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRealTimeTrafficDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRealTimeTrafficData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRealTimeTrafficData(request: DescribeScdnDomainRealTimeTrafficDataRequest): DescribeScdnDomainRealTimeTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRealTimeTrafficDataWithOptions(request, runtime);
}

model DescribeScdnDomainRegionDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-07T12:00:00Z'),
  startTime?: string(name='StartTime', example='2015-12-05T12:00:00Z'),
}

model DescribeScdnDomainRegionDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='86400'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-12-05T12:00:00Z'),
  requestId?: string(name='RequestId', example='2E5AD83F-BD7B-462E-8319-2E30E305519A'),
  startTime?: string(name='StartTime', example='2015-12-07T12:00:00Z'),
  value?: {
    regionProportionData?: [ 
    {
      avgObjectSize?: string(name='AvgObjectSize', example='800019.0'),
      avgResponseRate?: string(name='AvgResponseRate', example='154.3345765545624'),
      avgResponseTime?: string(name='AvgResponseTime', example='5183.666666666667'),
      bps?: string(name='Bps', example='380.9614285714286'),
      bytesProportion?: string(name='BytesProportion', example='0.003544181046236794'),
      proportion?: string(name='Proportion', example='0.01155980271270037'),
      qps?: string(name='Qps', example='5.9523809523809524E-5'),
      region?: string(name='Region'),
      regionEname?: string(name='RegionEname', example='" "'),
      reqErrRate?: string(name='ReqErrRate', example='0'),
      totalBytes?: string(name='TotalBytes', example='2400057'),
      totalQuery?: string(name='TotalQuery', example='3'),
    }
  ](name='RegionProportionData')
  }(name='Value'),
}

model DescribeScdnDomainRegionDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainRegionDataResponseBody(name='body'),
}

async function describeScdnDomainRegionDataWithOptions(request: DescribeScdnDomainRegionDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainRegionDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainRegionData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainRegionData(request: DescribeScdnDomainRegionDataRequest): DescribeScdnDomainRegionDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainRegionDataWithOptions(request, runtime);
}

model DescribeScdnDomainTopReferVisitRequest {
  domainName?: string(name='DomainName', example='example.com'),
  sortBy?: string(name='SortBy', example='pv'),
  startTime?: string(name='StartTime', example='2018-10-03T16:00:00Z'),
}

model DescribeScdnDomainTopReferVisitResponseBody = {
  domainName?: string(name='DomainName', example='example.com'),
  requestId?: string(name='RequestId', example='95994621-8382-464B-8762-C708E73568D1'),
  startTime?: string(name='StartTime', example='2018-10-03T16:00:00Z'),
  topReferList?: {
    referList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      referDetail?: string(name='ReferDetail', example='123.XXX.XXX.158'),
      visitData?: string(name='VisitData', example='229567'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='ReferList')
  }(name='TopReferList'),
}

model DescribeScdnDomainTopReferVisitResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainTopReferVisitResponseBody(name='body'),
}

async function describeScdnDomainTopReferVisitWithOptions(request: DescribeScdnDomainTopReferVisitRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainTopReferVisitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainTopReferVisit',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainTopReferVisit(request: DescribeScdnDomainTopReferVisitRequest): DescribeScdnDomainTopReferVisitResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainTopReferVisitWithOptions(request, runtime);
}

model DescribeScdnDomainTopUrlVisitRequest {
  domainName?: string(name='DomainName', example='example.com'),
  sortBy?: string(name='SortBy', example='pv'),
  startTime?: string(name='StartTime', example='2018-10-03T16:00:00Z'),
}

model DescribeScdnDomainTopUrlVisitResponseBody = {
  allUrlList?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      urlDetail?: string(name='UrlDetail', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', example='161673'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='UrlList')
  }(name='AllUrlList'),
  domainName?: string(name='DomainName', example='example.com'),
  requestId?: string(name='RequestId', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  startTime?: string(name='StartTime', example='2018-10-03T16:00:00Z'),
  url200List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      urlDetail?: string(name='UrlDetail', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', example='161673'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url200List'),
  url300List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      urlDetail?: string(name='UrlDetail', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', example='161673'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url300List'),
  url400List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      urlDetail?: string(name='UrlDetail', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', example='161673'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url400List'),
  url500List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', example='460486880'),
      flowProportion?: float(name='FlowProportion', example='0.35'),
      urlDetail?: string(name='UrlDetail', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', example='161673'),
      visitProportion?: float(name='VisitProportion', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url500List'),
}

model DescribeScdnDomainTopUrlVisitResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainTopUrlVisitResponseBody(name='body'),
}

async function describeScdnDomainTopUrlVisitWithOptions(request: DescribeScdnDomainTopUrlVisitRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainTopUrlVisitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainTopUrlVisit',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainTopUrlVisit(request: DescribeScdnDomainTopUrlVisitRequest): DescribeScdnDomainTopUrlVisitResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainTopUrlVisitWithOptions(request, runtime);
}

model DescribeScdnDomainTrafficDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  interval?: string(name='Interval', example='300'),
  ispNameEn?: string(name='IspNameEn', example='alibaba'),
  locationNameEn?: string(name='LocationNameEn', example='cn-hangzhou'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
}

model DescribeScdnDomainTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
  startTime?: string(name='StartTime', example='2017-12-10T20:00:00Z'),
  trafficDataPerInterval?: {
    dataModule?: [ 
    {
      httpTrafficValue?: string(name='HttpTrafficValue', example='0'),
      httpsTrafficValue?: string(name='HttpsTrafficValue', example='423304182'),
      timeStamp?: string(name='TimeStamp', example='2017-12-10T20:00:00Z'),
      trafficValue?: string(name='TrafficValue', example='423304182'),
    }
  ](name='DataModule')
  }(name='TrafficDataPerInterval'),
}

model DescribeScdnDomainTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainTrafficDataResponseBody(name='body'),
}

async function describeScdnDomainTrafficDataWithOptions(request: DescribeScdnDomainTrafficDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainTrafficDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!Util.isUnset(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainTrafficData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainTrafficData(request: DescribeScdnDomainTrafficDataRequest): DescribeScdnDomainTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainTrafficDataWithOptions(request, runtime);
}

model DescribeScdnDomainUvDataRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-11-30T00:00:00Z'),
  startTime?: string(name='StartTime', example='2015-11-29T00:00:00Z'),
}

model DescribeScdnDomainUvDataResponseBody = {
  dataInterval?: string(name='DataInterval', example='300'),
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2015-11-30T00:00:00Z'),
  requestId?: string(name='RequestId', example='E9D3257A-1B7C-414C-90C1-8D07AC47BCAC'),
  startTime?: string(name='StartTime', example='2015-11-29T00:00:00Z'),
  uvDataInterval?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', example='2015-11-29T20:00:00Z'),
      value?: string(name='Value', example='318'),
    }
  ](name='UsageData')
  }(name='UvDataInterval'),
}

model DescribeScdnDomainUvDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnDomainUvDataResponseBody(name='body'),
}

async function describeScdnDomainUvDataWithOptions(request: DescribeScdnDomainUvDataRequest, runtime: Util.RuntimeOptions): DescribeScdnDomainUvDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnDomainUvData',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnDomainUvData(request: DescribeScdnDomainUvDataRequest): DescribeScdnDomainUvDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnDomainUvDataWithOptions(request, runtime);
}

model DescribeScdnRefreshQuotaRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnRefreshQuotaResponseBody = {
  blockQuota?: string(name='BlockQuota', example='100'),
  dirQuota?: string(name='DirQuota', example='100'),
  dirRemain?: string(name='DirRemain', example='99'),
  preloadQuota?: string(name='PreloadQuota', example='500'),
  preloadRemain?: string(name='PreloadRemain', example='400'),
  requestId?: string(name='RequestId', example='42E0554B-80F4-4921-AED6-ACFB22CAAAD0'),
  urlQuota?: string(name='UrlQuota', example='2000'),
  urlRemain?: string(name='UrlRemain', example='1996'),
  blockRemain?: string(name='blockRemain', example='100'),
}

model DescribeScdnRefreshQuotaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnRefreshQuotaResponseBody(name='body'),
}

async function describeScdnRefreshQuotaWithOptions(request: DescribeScdnRefreshQuotaRequest, runtime: Util.RuntimeOptions): DescribeScdnRefreshQuotaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnRefreshQuota',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnRefreshQuota(request: DescribeScdnRefreshQuotaRequest): DescribeScdnRefreshQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnRefreshQuotaWithOptions(request, runtime);
}

model DescribeScdnRefreshTasksRequest {
  domainName?: string(name='DomainName', example='example.com'),
  endTime?: string(name='EndTime', example='2017-01-01T12:13:20Z'),
  objectPath?: string(name='ObjectPath', example='http://example.com/examplefile.txt'),
  objectType?: string(name='ObjectType', example='file'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyuji4b6****'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', example='2017-01-01T12:12:20Z'),
  status?: string(name='Status', example='Complete'),
  taskId?: string(name='TaskId', example='70422****'),
}

model DescribeScdnRefreshTasksResponseBody = {
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='174F6032-AA26-470D-B90E-36F0EB205BEE'),
  tasks?: {
    task?: [ 
    {
      creationTime?: string(name='CreationTime', example='2014-11-27T08:18:38Z'),
      description?: string(name='Description', example='Internal Error'),
      objectPath?: string(name='ObjectPath', example='http://example.com/examplefile.txt'),
      objectType?: string(name='ObjectType', example='file'),
      process?: string(name='Process', example='100%'),
      status?: string(name='Status', example='Complete'),
      taskId?: string(name='TaskId', example='704225667'),
    }
  ](name='Task')
  }(name='Tasks'),
  totalCount?: long(name='TotalCount', example='2'),
}

model DescribeScdnRefreshTasksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnRefreshTasksResponseBody(name='body'),
}

async function describeScdnRefreshTasksWithOptions(request: DescribeScdnRefreshTasksRequest, runtime: Util.RuntimeOptions): DescribeScdnRefreshTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!Util.isUnset(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnRefreshTasks',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnRefreshTasks(request: DescribeScdnRefreshTasksRequest): DescribeScdnRefreshTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnRefreshTasksWithOptions(request, runtime);
}

model DescribeScdnServiceRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnServiceResponseBody = {
  bandwidth?: string(name='Bandwidth', example='100Mbps'),
  bandwidthValue?: string(name='BandwidthValue', example='100'),
  ccProtection?: string(name='CcProtection', example='60000Qps'),
  ccProtectionValue?: string(name='CcProtectionValue', example='60000'),
  changingAffectTime?: string(name='ChangingAffectTime', example='2018-03-31T16:00:00Z'),
  changingChargeType?: string(name='ChangingChargeType', example='PayByBandwidth'),
  currentBandwidth?: string(name='CurrentBandwidth', example='3 M'),
  currentBandwidthValue?: string(name='CurrentBandwidthValue', example='3'),
  currentCcProtection?: string(name='CurrentCcProtection', example='60,000 QPS'),
  currentCcProtectionValue?: string(name='CurrentCcProtectionValue', example='60000'),
  currentDDoSBasic?: string(name='CurrentDDoSBasic', example='30Gbps'),
  currentDDoSBasicValue?: string(name='CurrentDDoSBasicValue', example='30'),
  currentDomainCount?: string(name='CurrentDomainCount', example='20'),
  currentDomainCountValue?: string(name='CurrentDomainCountValue', example='20'),
  currentElasticProtection?: string(name='CurrentElasticProtection', example='100Gbps'),
  currentElasticProtectionValue?: string(name='CurrentElasticProtectionValue', example='100'),
  currentProtectType?: string(name='CurrentProtectType'),
  currentProtectTypeValue?: string(name='CurrentProtectTypeValue', example='standard'),
  DDoSBasic?: string(name='DDoSBasic', example='20Gbps'),
  DDoSBasicValue?: string(name='DDoSBasicValue', example='20'),
  domainCount?: string(name='DomainCount'),
  domainCountValue?: string(name='DomainCountValue', example='20'),
  elasticProtection?: string(name='ElasticProtection', example='100Gbps'),
  elasticProtectionValue?: string(name='ElasticProtectionValue', example='100'),
  endTime?: string(name='EndTime', example='2014-12-08T00:00:00Z'),
  instanceId?: string(name='InstanceId', example='example ID'),
  internetChargeType?: string(name='InternetChargeType', example='PayByTraffic'),
  openTime?: string(name='OpenTime', example='2017-11-07T16:00:00Z'),
  operationLocks?: {
    lockReason?: [ 
    {
      lockReason?: string(name='LockReason', example='financial'),
    }
  ](name='LockReason')
  }(name='OperationLocks'),
  priceType?: string(name='PriceType', example='monthPrice'),
  pricingCycle?: string(name='PricingCycle', example='Year'),
  protectType?: string(name='ProtectType'),
  protectTypeValue?: string(name='ProtectTypeValue', example='standard'),
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model DescribeScdnServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnServiceResponseBody(name='body'),
}

async function describeScdnServiceWithOptions(request: DescribeScdnServiceRequest, runtime: Util.RuntimeOptions): DescribeScdnServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnService',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnService(request: DescribeScdnServiceRequest): DescribeScdnServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnServiceWithOptions(request, runtime);
}

model DescribeScdnTopDomainsByFlowRequest {
  endTime?: string(name='EndTime', example='2016-03-14T07:34:00Z'),
  limit?: long(name='Limit', example='5'),
  product?: string(name='Product', example='scdn'),
  startTime?: string(name='StartTime', example='2016-03-01T04:00:00Z'),
}

model DescribeScdnTopDomainsByFlowResponseBody = {
  domainCount?: long(name='DomainCount', example='68'),
  domainOnlineCount?: long(name='DomainOnlineCount', example='68'),
  endTime?: string(name='EndTime', example='2016-03-14T07:34:00Z'),
  requestId?: string(name='RequestId', example='4E09C5D7-E1CF-4CAA-A45E-8727F4C8FD70'),
  startTime?: string(name='StartTime', example='2016-03-14T06:34:00Z'),
  topDomains?: {
    topDomain?: [ 
    {
      domainName?: string(name='DomainName', example='example.com'),
      maxBps?: long(name='MaxBps', example='22139626'),
      maxBpsTime?: string(name='MaxBpsTime', example='2018-11-01T08:10:00Z'),
      rank?: long(name='Rank', example='1'),
      totalAccess?: long(name='TotalAccess', example='3'),
      totalTraffic?: string(name='TotalTraffic', example='123'),
      trafficPercent?: string(name='TrafficPercent', example='21.686305274906182'),
    }
  ](name='TopDomain')
  }(name='TopDomains'),
}

model DescribeScdnTopDomainsByFlowResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnTopDomainsByFlowResponseBody(name='body'),
}

async function describeScdnTopDomainsByFlowWithOptions(request: DescribeScdnTopDomainsByFlowRequest, runtime: Util.RuntimeOptions): DescribeScdnTopDomainsByFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnTopDomainsByFlow',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnTopDomainsByFlow(request: DescribeScdnTopDomainsByFlowRequest): DescribeScdnTopDomainsByFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnTopDomainsByFlowWithOptions(request, runtime);
}

model DescribeScdnUserDomainsRequest {
  changeEndTime?: string(name='ChangeEndTime', example='201911111'),
  changeStartTime?: string(name='ChangeStartTime', example='201911111'),
  checkDomainShow?: boolean(name='CheckDomainShow', example='false'),
  domainName?: string(name='DomainName', example='example.com'),
  domainSearchType?: string(name='DomainSearchType', example='fuzzy_match'),
  domainStatus?: string(name='DomainStatus'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='5'),
  resourceGroupId?: string(name='ResourceGroupId', example='123'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnUserDomainsResponseBody = {
  domains?: {
    pageData?: [ 
    {
      cname?: string(name='Cname', example='image.developer.aliyundoc.com'),
      description?: string(name='Description', example='audit failed'),
      domainName?: string(name='DomainName', example='example.aliyun.com'),
      domainStatus?: string(name='DomainStatus', example='online'),
      gmtCreated?: string(name='GmtCreated', example='2015-10-28T11:05:52Z'),
      gmtModified?: string(name='GmtModified', example='2015-10-28T11:05:52Z'),
      resourceGroupId?: string(name='ResourceGroupId', example='abcd1234abcd1234'),
      SSLProtocol?: string(name='SSLProtocol', example='on'),
      sandbox?: string(name='Sandbox', example='normal'),
      sources?: {
        source?: [ 
        {
          content?: string(name='Content', example='video.developer.aliyundoc.com'),
          port?: int32(name='Port', example='80'),
          priority?: string(name='Priority', example='50'),
          type?: string(name='Type', example='oss'),
        }
      ](name='Source')
      }(name='Sources'),
    }
  ](name='PageData')
  }(name='Domains'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='5'),
  requestId?: string(name='RequestId', example='AA75AADB-5E25-4970-B480-EAA1F5658483'),
  totalCount?: long(name='TotalCount', example='16'),
}

model DescribeScdnUserDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnUserDomainsResponseBody(name='body'),
}

async function describeScdnUserDomainsWithOptions(request: DescribeScdnUserDomainsRequest, runtime: Util.RuntimeOptions): DescribeScdnUserDomainsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.changeEndTime)) {
    query['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeStartTime)) {
    query['ChangeStartTime'] = request.changeStartTime;
  }
  if (!Util.isUnset(request.checkDomainShow)) {
    query['CheckDomainShow'] = request.checkDomainShow;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.domainSearchType)) {
    query['DomainSearchType'] = request.domainSearchType;
  }
  if (!Util.isUnset(request.domainStatus)) {
    query['DomainStatus'] = request.domainStatus;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnUserDomains',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnUserDomains(request: DescribeScdnUserDomainsRequest): DescribeScdnUserDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnUserDomainsWithOptions(request, runtime);
}

model DescribeScdnUserProtectInfoResponseBody = {
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
  serviceDDoS?: int32(name='ServiceDDoS', example='1'),
}

model DescribeScdnUserProtectInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnUserProtectInfoResponseBody(name='body'),
}

async function describeScdnUserProtectInfoWithOptions(runtime: Util.RuntimeOptions): DescribeScdnUserProtectInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeScdnUserProtectInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnUserProtectInfo(): DescribeScdnUserProtectInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnUserProtectInfoWithOptions(runtime);
}

model DescribeScdnUserQuotaRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeScdnUserQuotaResponseBody = {
  blockQuota?: int32(name='BlockQuota', example='20'),
  blockRemain?: int32(name='BlockRemain', example='500'),
  domainQuota?: int32(name='DomainQuota', example='50'),
  preloadQuota?: int32(name='PreloadQuota', example='500'),
  preloadRemain?: int32(name='PreloadRemain', example='300'),
  refreshDirQuota?: int32(name='RefreshDirQuota', example='100'),
  refreshDirRemain?: int32(name='RefreshDirRemain', example='100'),
  refreshUrlQuota?: int32(name='RefreshUrlQuota', example='100'),
  refreshUrlRemain?: int32(name='RefreshUrlRemain', example='100'),
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model DescribeScdnUserQuotaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnUserQuotaResponseBody(name='body'),
}

async function describeScdnUserQuotaWithOptions(request: DescribeScdnUserQuotaRequest, runtime: Util.RuntimeOptions): DescribeScdnUserQuotaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnUserQuota',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnUserQuota(request: DescribeScdnUserQuotaRequest): DescribeScdnUserQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnUserQuotaWithOptions(request, runtime);
}

model DescribeScdnVerifyContentRequest {
  domainName?: string(name='DomainName'),
}

model DescribeScdnVerifyContentResponseBody = {
  content?: string(name='Content'),
  requestId?: string(name='RequestId'),
}

model DescribeScdnVerifyContentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeScdnVerifyContentResponseBody(name='body'),
}

async function describeScdnVerifyContentWithOptions(request: DescribeScdnVerifyContentRequest, runtime: Util.RuntimeOptions): DescribeScdnVerifyContentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeScdnVerifyContent',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeScdnVerifyContent(request: DescribeScdnVerifyContentRequest): DescribeScdnVerifyContentResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeScdnVerifyContentWithOptions(request, runtime);
}

model PreloadScdnObjectCachesRequest {
  area?: string(name='Area', example='overseas'),
  l2Preload?: boolean(name='L2Preload', example='false'),
  objectPath?: string(name='ObjectPath', example='example.aliyundoc.com/examplefile.txt'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  withHeader?: string(name='WithHeader'),
}

model PreloadScdnObjectCachesResponseBody = {
  preloadTaskId?: string(name='PreloadTaskId', example='9524****'),
  requestId?: string(name='RequestId', example='E5BD4B50-7A02-493A-AE0B-97B9024B413'),
}

model PreloadScdnObjectCachesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PreloadScdnObjectCachesResponseBody(name='body'),
}

async function preloadScdnObjectCachesWithOptions(request: PreloadScdnObjectCachesRequest, runtime: Util.RuntimeOptions): PreloadScdnObjectCachesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.area)) {
    query['Area'] = request.area;
  }
  if (!Util.isUnset(request.l2Preload)) {
    query['L2Preload'] = request.l2Preload;
  }
  if (!Util.isUnset(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.withHeader)) {
    query['WithHeader'] = request.withHeader;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PreloadScdnObjectCaches',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function preloadScdnObjectCaches(request: PreloadScdnObjectCachesRequest): PreloadScdnObjectCachesResponse {
  var runtime = new Util.RuntimeOptions{};
  return preloadScdnObjectCachesWithOptions(request, runtime);
}

model RefreshScdnObjectCachesRequest {
  objectPath?: string(name='ObjectPath', example='example.aliyundoc.com/examplefile.txt'),
  objectType?: string(name='ObjectType', example='File'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RefreshScdnObjectCachesResponseBody = {
  refreshTaskId?: string(name='RefreshTaskId', example='704222904'),
  requestId?: string(name='RequestId', example='D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C'),
}

model RefreshScdnObjectCachesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RefreshScdnObjectCachesResponseBody(name='body'),
}

async function refreshScdnObjectCachesWithOptions(request: RefreshScdnObjectCachesRequest, runtime: Util.RuntimeOptions): RefreshScdnObjectCachesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!Util.isUnset(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefreshScdnObjectCaches',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshScdnObjectCaches(request: RefreshScdnObjectCachesRequest): RefreshScdnObjectCachesResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshScdnObjectCachesWithOptions(request, runtime);
}

model SetScdnBotInfoRequest {
  domainName?: string(name='DomainName', example='example.com'),
  enable?: string(name='Enable', example='on'),
  status?: string(name='Status', example='limit'),
}

model SetScdnBotInfoResponseBody = {
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model SetScdnBotInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetScdnBotInfoResponseBody(name='body'),
}

async function setScdnBotInfoWithOptions(request: SetScdnBotInfoRequest, runtime: Util.RuntimeOptions): SetScdnBotInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetScdnBotInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setScdnBotInfo(request: SetScdnBotInfoRequest): SetScdnBotInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScdnBotInfoWithOptions(request, runtime);
}

model SetScdnCcInfoRequest {
  status?: string(name='Status', example='enable'),
}

model SetScdnCcInfoResponseBody = {
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model SetScdnCcInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetScdnCcInfoResponseBody(name='body'),
}

async function setScdnCcInfoWithOptions(request: SetScdnCcInfoRequest, runtime: Util.RuntimeOptions): SetScdnCcInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetScdnCcInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setScdnCcInfo(request: SetScdnCcInfoRequest): SetScdnCcInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScdnCcInfoWithOptions(request, runtime);
}

model SetScdnDDoSInfoRequest {
  elasticBandwidth?: int32(name='ElasticBandwidth', example='10'),
}

model SetScdnDDoSInfoResponseBody = {
  requestId?: string(name='RequestId', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model SetScdnDDoSInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetScdnDDoSInfoResponseBody(name='body'),
}

async function setScdnDDoSInfoWithOptions(request: SetScdnDDoSInfoRequest, runtime: Util.RuntimeOptions): SetScdnDDoSInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetScdnDDoSInfo',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setScdnDDoSInfo(request: SetScdnDDoSInfoRequest): SetScdnDDoSInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScdnDDoSInfoWithOptions(request, runtime);
}

model SetScdnDomainCertificateRequest {
  certName?: string(name='CertName', example='yourCertName'),
  certType?: string(name='CertType', example='cas'),
  domainName?: string(name='DomainName', example='example.com'),
  forceSet?: string(name='ForceSet', example='1'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', example='cn-shanghai'),
  SSLPri?: string(name='SSLPri', example='SSLPri'),
  SSLProtocol?: string(name='SSLProtocol', example='on'),
  SSLPub?: string(name='SSLPub', example='SSLPub'),
  securityToken?: string(name='SecurityToken'),
}

model SetScdnDomainCertificateResponseBody = {
  requestId?: string(name='RequestId', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model SetScdnDomainCertificateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetScdnDomainCertificateResponseBody(name='body'),
}

async function setScdnDomainCertificateWithOptions(request: SetScdnDomainCertificateRequest, runtime: Util.RuntimeOptions): SetScdnDomainCertificateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.forceSet)) {
    query['ForceSet'] = request.forceSet;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.SSLPri)) {
    query['SSLPri'] = request.SSLPri;
  }
  if (!Util.isUnset(request.SSLProtocol)) {
    query['SSLProtocol'] = request.SSLProtocol;
  }
  if (!Util.isUnset(request.SSLPub)) {
    query['SSLPub'] = request.SSLPub;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetScdnDomainCertificate',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setScdnDomainCertificate(request: SetScdnDomainCertificateRequest): SetScdnDomainCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScdnDomainCertificateWithOptions(request, runtime);
}

model StartScdnDomainRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StartScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model StartScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartScdnDomainResponseBody(name='body'),
}

async function startScdnDomainWithOptions(request: StartScdnDomainRequest, runtime: Util.RuntimeOptions): StartScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startScdnDomain(request: StartScdnDomainRequest): StartScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return startScdnDomainWithOptions(request, runtime);
}

model StopScdnDomainRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StopScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='324AEFFF-308C-4DA7-8CD3-01B277B98F28'),
}

model StopScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopScdnDomainResponseBody(name='body'),
}

async function stopScdnDomainWithOptions(request: StopScdnDomainRequest, runtime: Util.RuntimeOptions): StopScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopScdnDomain(request: StopScdnDomainRequest): StopScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopScdnDomainWithOptions(request, runtime);
}

model UpdateScdnDomainRequest {
  domainName?: string(name='DomainName', example='example.com'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyuji4b6r4ry'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]'),
}

model UpdateScdnDomainResponseBody = {
  requestId?: string(name='RequestId', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model UpdateScdnDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateScdnDomainResponseBody(name='body'),
}

async function updateScdnDomainWithOptions(request: UpdateScdnDomainRequest, runtime: Util.RuntimeOptions): UpdateScdnDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sources)) {
    query['Sources'] = request.sources;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateScdnDomain',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateScdnDomain(request: UpdateScdnDomainRequest): UpdateScdnDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateScdnDomainWithOptions(request, runtime);
}

model VerifyScdnDomainOwnerRequest {
  domainName?: string(name='DomainName'),
  verifyType?: string(name='VerifyType'),
}

model VerifyScdnDomainOwnerResponseBody = {
  content?: string(name='Content'),
  requestId?: string(name='RequestId'),
}

model VerifyScdnDomainOwnerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifyScdnDomainOwnerResponseBody(name='body'),
}

async function verifyScdnDomainOwnerWithOptions(request: VerifyScdnDomainOwnerRequest, runtime: Util.RuntimeOptions): VerifyScdnDomainOwnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.verifyType)) {
    query['VerifyType'] = request.verifyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyScdnDomainOwner',
    version = '2017-11-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyScdnDomainOwner(request: VerifyScdnDomainOwnerRequest): VerifyScdnDomainOwnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyScdnDomainOwnerWithOptions(request, runtime);
}

